const Service = require('egg').Service;

class AbiService extends Service {
    // 提现 UserAccount_ABI
    async WithDraw_CtrAddr() {
        const WithDraw_CtrAddr = "0xca6203551ae0a0a23effa372d9f61a5b21c19988"
        return await WithDraw_CtrAddr;
    }
    async WithDraw_ABI() {
        const ABI = [
            {
                "constant": false,
                "inputs": [
                    {
                        "name": "uuid",
                        "type": "bytes32"
                    },
                    {
                        "name": "withdrawAmount",
                        "type": "uint256"
                    },
                    {
                        "name": "sign",
                        "type": "bytes"
                    }
                ],
                "name": "ActionCallBack_WithDraw",
                "outputs": [],
                "payable": false,
                "stateMutability": "nonpayable",
                "type": "function"
            },
            {
                "inputs": [
                    {
                        "name": "rootUser",
                        "type": "address"
                    },
                    {
                        "name": "userAccountDataAddr",
                        "type": "address"
                    },
                    {
                        "name": "eventCtrAddr",
                        "type": "address"
                    }
                ],
                "payable": false,
                "stateMutability": "nonpayable",
                "type": "constructor"
            },
            {
                "constant": false,
                "inputs": [
                    {
                        "name": "parentAddr",
                        "type": "address"
                    }
                ],
                "name": "UserDeposit",
                "outputs": [],
                "payable": true,
                "stateMutability": "payable",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [
                    {
                        "name": "",
                        "type": "bytes32"
                    }
                ],
                "name": "IsActionExecutedByUuid",
                "outputs": [
                    {
                        "name": "",
                        "type": "bool"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [],
                "name": "RootUser",
                "outputs": [
                    {
                        "name": "",
                        "type": "address"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            }
        ]
    
        return await ABI;
    }

    // 订单 Mini2f
    async Order_CtrAddr() {
        const Order_CtrAddr = "0x5186ed68de3100d2aa03deeda3ee81e723316ffd"
        return Order_CtrAddr;
    }

    async Order_ABI() {
        const  ABI = [
            {
                "constant": false,
                "inputs": [
                    {
                        "name": "uuid",
                        "type": "bytes32"
                    },
                    {
                        "name": "tradeAmount",
                        "type": "uint256"
                    },
                    {
                        "name": "isBuy",
                        "type": "bool"
                    },
                    {
                        "name": "srvTimestamp",
                        "type": "uint256"
                    },
                    {
                        "name": "sign",
                        "type": "bytes"
                    }
                ],
                "name": "ActionCallBack_SettleOrder",
                "outputs": [],
                "payable": false,
                "stateMutability": "nonpayable",
                "type": "function"
            },
            {
                "constant": false,
                "inputs": [
                    {
                        "name": "roundId",
                        "type": "uint256"
                    }
                ],
                "name": "devideGrandPrize",
                "outputs": [],
                "payable": false,
                "stateMutability": "nonpayable",
                "type": "function"
            },
            {
                "constant": false,
                "inputs": [
                    {
                        "name": "startTime",
                        "type": "uint256"
                    },
                    {
                        "name": "openPrice",
                        "type": "uint256"
                    },
                    {
                        "name": "closePrice",
                        "type": "uint256"
                    },
                    {
                        "name": "buyVol",
                        "type": "uint256"
                    },
                    {
                        "name": "sellVol",
                        "type": "uint256"
                    },
                    {
                        "name": "isResultUpdateSuccess",
                        "type": "bool"
                    }
                ],
                "name": "UpdateRound",
                "outputs": [],
                "payable": false,
                "stateMutability": "nonpayable",
                "type": "function"
            },
            {
                "inputs": [
                    {
                        "name": "period",
                        "type": "uint256"
                    },
                    {
                        "name": "minTradeAmount",
                        "type": "uint256"
                    },
                    {
                        "name": "dataUser",
                        "type": "address"
                    },
                    {
                        "name": "userAccountDataAddr",
                        "type": "address"
                    },
                    {
                        "name": "eventCtrAddr",
                        "type": "address"
                    }
                ],
                "payable": true,
                "stateMutability": "payable",
                "type": "constructor"
            },
            {
                "constant": false,
                "inputs": [
                    {
                        "name": "increaseAmount",
                        "type": "uint256"
                    },
                    {
                        "name": "decreaseAmount",
                        "type": "uint256"
                    },
                    {
                        "name": "isIncrease",
                        "type": "bool"
                    }
                ],
                "name": "updateGrandPrizePool",
                "outputs": [],
                "payable": false,
                "stateMutability": "nonpayable",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [
                    {
                        "name": "timeStamp",
                        "type": "uint256"
                    },
                    {
                        "name": "period",
                        "type": "uint256"
                    }
                ],
                "name": "calcStartTime",
                "outputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "pure",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    },
                    {
                        "name": "",
                        "type": "address"
                    }
                ],
                "name": "CheckOrderRepeat",
                "outputs": [
                    {
                        "name": "",
                        "type": "bool"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [],
                "name": "DataUser",
                "outputs": [
                    {
                        "name": "",
                        "type": "address"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [],
                "name": "grandPrizePoolBalance",
                "outputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [
                    {
                        "name": "",
                        "type": "bytes32"
                    }
                ],
                "name": "IsActionExecutedByUuid",
                "outputs": [
                    {
                        "name": "",
                        "type": "bool"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [],
                "name": "MinTradeAmount",
                "outputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [],
                "name": "onlyIncreaseCount",
                "outputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [],
                "name": "Period",
                "outputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [],
                "name": "RootUser",
                "outputs": [
                    {
                        "name": "",
                        "type": "address"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [],
                "name": "RoundCount",
                "outputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "name": "RoundIdByStartTime",
                "outputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    },
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "name": "roundIdForGrandPriceUserId",
                "outputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "name": "Rounds",
                "outputs": [
                    {
                        "name": "startTime",
                        "type": "uint256"
                    },
                    {
                        "name": "openPrice",
                        "type": "uint256"
                    },
                    {
                        "name": "closePrice",
                        "type": "uint256"
                    },
                    {
                        "name": "buyVol",
                        "type": "uint256"
                    },
                    {
                        "name": "sellVol",
                        "type": "uint256"
                    },
                    {
                        "name": "increaseGrandPricePoolAmount",
                        "type": "uint256"
                    },
                    {
                        "name": "resultUpdateTime",
                        "type": "uint256"
                    },
                    {
                        "name": "isResultUpdateSuccess",
                        "type": "bool"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [],
                "name": "TradeCount",
                "outputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "name": "Trades",
                "outputs": [
                    {
                        "name": "roundId",
                        "type": "uint256"
                    },
                    {
                        "name": "orderCreateTime",
                        "type": "uint256"
                    },
                    {
                        "name": "isBuy",
                        "type": "bool"
                    },
                    {
                        "name": "amount",
                        "type": "uint256"
                    },
                    {
                        "name": "userId",
                        "type": "uint256"
                    },
                    {
                        "name": "result",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            },
            {
                "constant": true,
                "inputs": [
                    {
                        "name": "",
                        "type": "address"
                    }
                ],
                "name": "UserLoserCount",
                "outputs": [
                    {
                        "name": "",
                        "type": "uint256"
                    }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
            }
        ]

        return ABI;
    }
    

}
module.exports = AbiService;